Skip to content

test(engine): preserve files written by past releases - #2103

Merged
Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:t3/saved-file-release-fixtures
Nov 15, 2026
Merged

Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:t3/saved-file-release-fixtures

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Summary

Keep real projects and settings written by every tagged release from v0.2.0 through v0.6.0. This gives future reader changes a regression test against files existing users can already have, before #1853 starts writing project format 2.

  • Ten unchanged files written by the published Linux binaries, totaling 16,642 bytes: two tiny layers per project and desktop preferences from isolated settings folders.
  • One test opens each project through project.open and each preferences file through the desktop preferences reader. It checks layer order and IDs, feature geometry and attributes, symbology, labels, definition-query results, transparency, camera and settings, and requires the exact successful-open notice.
  • Record writer provenance and archive checksums; document that historical fixtures are never regenerated and each release adds its own files. Preserve exact bytes with a fixture-local Git attribute and a narrow end-of-file-fixer exception for these ten files.

Testing

  • released_projects_and_preferences_still_open: all five release pairs pass.
  • cargo xtask changed passed for the engine and its eight dependants (formatting, Clippy, tests and layers).
  • RUSTFLAGS="-D warnings" cargo check -p rustgis-engine --target wasm32-unknown-unknown passed.
  • Full fork CI: Linux gate, passed on 270fddebf3230860f1929bc4820921adf7d1ad1e.

UI evidence

No visible UI change.

Related issue

Compatibility coverage for #1853 and #1405; complements the current-writer schema fixtures in #2065.

Summary by CodeRabbit

  • Tests

    • Added compatibility checks for projects and preferences saved by releases v0.2.0–v0.6.0, verifying they still open and retain expected settings and content.
  • Documentation

    • Documented how to preserve and extend historical saved-file fixtures for future releases.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Adds project and preference fixtures written by RustGIS v0.2.0–v0.6.0. Adds tests that load the fixtures and check saved settings, project state, and layer properties. Documentation records fixture provenance and preservation requirements.

Changes: Release compatibility

Layer / File(s) Summary
Historical release fixtures
crates/engine/testdata/releases/*, .pre-commit-config.yaml, ATTRIBUTION.md, docs/maintaining.md
Adds project and preference fixtures from five releases. Documents their source, contents, and preservation requirements. Git and pre-commit settings preserve fixture bytes and line endings.
Historical file compatibility test
crates/engine/src/prefs.rs, crates/engine/src/tests/released_files.rs
Loads fixtures for each release and checks preference counts, opening notices, and persisted project, map, and layer properties.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related issues

  • opengeos/RustGIS#1405 — Adds tests that check whether current code opens saved files from earlier releases.
  • opengeos/RustGIS#1853 — Checks that saved project files from earlier releases continue to open.
  • opengeos/RustGIS#748 — Automates related checks for older saved projects, but does not complete the issue’s manual testing request.
Merge Risk: Minimal · up to 270fd

This change adds historical release files and a test that current code can still open them. It does not change runtime behavior, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "test(engine): preserve files written by past releases" matches the main change. The PR adds unchanged project and preferences fixtures from releases v0.2.0 through v0.6.0 and a compatibilit…
Description check Passed The description follows the template's Summary, Testing, UI evidence, and Related issue sections. The Summary explains what changed and why. The Testing section lists the new test, the xtask run, the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(engine): preserve files written by past releases" matches the main change. The PR adds unchanged project and preferences fixtures from releases v0.2.0 through v0.6.0 and a compatibility test that opens them. The title is concise, specific, and follows a conventional commit style.

Full details: Description check

Explanation

The description follows the template's Summary, Testing, UI evidence, and Related issue sections. The Summary explains what changed and why. The Testing section lists the new test, the xtask run, the wasm check, and the CI run. The UI evidence section states no visible UI change, which the template allows. The Related issue section names #1853, #1405, and #2065, though it does not use the template's Closes or Part of wording.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks each saved file,
Five releases hop into a row.
Maps and layers pass the test,
Preferences keep their shape just so.
The burrow stores their bytes below.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 489c58c3-797d-474e-bf79-1dc2f04ec246
Commits

Reviewing files that changed from the base of the PR and between 72680cf and 270fdde.

Files selected for processing: 17

  • .pre-commit-config.yaml
  • ATTRIBUTION.md
  • crates/engine/src/prefs.rs
  • crates/engine/src/tests/released_files.rs
  • crates/engine/testdata/releases/.gitattributes
  • crates/engine/testdata/releases/README.md
  • crates/engine/testdata/releases/v0.2.0.prefs.json
  • crates/engine/testdata/releases/v0.2.0.rgis
  • crates/engine/testdata/releases/v0.3.0.prefs.json
  • crates/engine/testdata/releases/v0.3.0.rgis
  • crates/engine/testdata/releases/v0.4.0.prefs.json
  • crates/engine/testdata/releases/v0.4.0.rgis
  • crates/engine/testdata/releases/v0.5.0.prefs.json
  • crates/engine/testdata/releases/v0.5.0.rgis
  • crates/engine/testdata/releases/v0.6.0.prefs.json
  • crates/engine/testdata/releases/v0.6.0.rgis
  • docs/maintaining.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

serde_json::to_value(&places.dataset.features).unwrap(),
json!([
{"id": 1, "geometry": {"Point": {"x": 1.0, "y": 2.0}}, "attrs": [{"Text": "Alpha"}, {"Int": 10}]},
{"id": 2, "geometry": {"Point": {"x": 3.0, "y": 4.0}}, "attrs": [{"Text": "Béta"}, {"Int": 20}]}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quality (test coverage), medium confidence. The version list is hard-coded, so a release whose v*.rgis / v*.prefs.json files are added to testdata/releases without extending this list passes silently. Only deletions fail (via unwrap). The docs make adding files a manual step, so the test should check the directory itself. Suggested change: list the fixtures on disk and require the list to match, so a new file fails until the test is extended.

Suggested change
{"id": 2, "geometry": {"Point": {"x": 3.0, "y": 4.0}}, "attrs": [{"Text": "Béta"}, {"Int": 20}]}
let fixtures = Path::new(env!("CARGO_MANIFEST_DIR")).join("testdata/releases");
let mut found: Vec<String> = std::fs::read_dir(&fixtures)
.unwrap()
.filter_map(|entry| entry.ok()?.file_name().into_string().ok())
.filter_map(|name| name.strip_suffix(".rgis").map(str::to_owned))
.collect();
found.sort();
assert_eq!(found, ["v0.2.0", "v0.3.0", "v0.4.0", "v0.5.0", "v0.6.0"]);

Not a blocker. The same list should also be checked against the README table, but that is a nit for the release quality pass.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. The list stays explicit for now; checking it against the files on disk is left for the release quality pass.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found on the changed lines. I checked the test's references against the source: prefs::read_at (private, reachable from the child module), Connections::from_json and unread(), Session::notices_since, Session::map, visible_rows, center_lonlat, and the Opened {name} notice in cmd/project.rs. The camera scale expectation also holds with the geodesic correction (res 70.096 / 0.00028 × cos 3° ≈ 250,000). I could not compile or run the tests here (no shell), so this rests on reading; the PR says CI passed on 270fdde.

Security: None. The change adds fixtures and a test, with no runtime input handling.

Performance: None.

Quality:

  • The version list in released_projects_and_preferences_still_open is hard-coded, so a new release's files that are added without extending it pass silently. Posted as an inline comment with a suggestion that lists the fixtures on disk. Medium confidence.
  • The test lives under src/tests/ but is mounted from prefs.rs, and it covers projects as well as preferences. A reader would likely assume it belongs to the crate-root tests module. A nit for the release quality pass.
  • Nothing checks that the README's archive table matches the files on disk. Nit, same pass.

AGENTS.md: No violations found. The end-of-file-fixer exclusion is narrow, the .gitattributes scope is fixture-local, the ATTRIBUTION row is present, and the new code's unwrap/panic! are in test code only. The schema/fixtures rule is not triggered because this PR does not change how projects are read. Not verifiable offline: the SHA-256 values and the "downloaded from GitHub releases" provenance in the fixture README. Please confirm these were computed from the release archives.

Earlier concerns: There are no prior review threads, so none were skipped.

Change size

Compared: the whole PR against main (merge base 5709134 to PR head 270fdde).

Measure Value
Files changed 17 (13 added, 4 modified, 0 removed, 0 renamed)
Size before 36.6 KB
Size after 61.3 KB
Total size change +24.7 KB
Path Before After Change
crates/engine/src/tests/released_files.rs 0 B 5.0 KB +5.0 KB
crates/engine/testdata/releases/v0.4.0.rgis 0 B 3.2 KB +3.2 KB
crates/engine/testdata/releases/v0.5.0.rgis 0 B 3.2 KB +3.2 KB
crates/engine/testdata/releases/v0.6.0.rgis 0 B 3.2 KB +3.2 KB
crates/engine/testdata/releases/v0.3.0.rgis 0 B 3.2 KB +3.2 KB
crates/engine/testdata/releases/v0.2.0.rgis 0 B 3.2 KB +3.2 KB
crates/engine/testdata/releases/README.md 0 B 2.3 KB +2.3 KB
docs/maintaining.md 5.3 KB 5.8 KB +514 B
ATTRIBUTION.md 10.0 KB 10.3 KB +327 B
.pre-commit-config.yaml 699 B 871 B +172 B
crates/engine/testdata/releases/.gitattributes 0 B 117 B +117 B
crates/engine/testdata/releases/v0.4.0.prefs.json 0 B 89 B +89 B
crates/engine/testdata/releases/v0.5.0.prefs.json 0 B 89 B +89 B
crates/engine/testdata/releases/v0.6.0.prefs.json 0 B 89 B +89 B
crates/engine/src/prefs.rs 20.7 KB 20.8 KB +70 B
crates/engine/testdata/releases/v0.2.0.prefs.json 0 B 27 B +27 B
crates/engine/testdata/releases/v0.3.0.prefs.json 0 B 27 B +27 B

@Mavrick-F
Mavrick-F merged commit 565f8a1 into opengeos:main Nov 15, 2026
20 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2103/
Web app https://preview.rustgis.app/pr-2103/app/
Commit 270fdde

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant